package com.itestor.iptv.modules.alert.actions;

import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.itestor.iptv.global.GlobalConstant;
import com.itestor.iptv.modules.alert.service.RobotLogService;
import com.itestor.iptv.modules.alert.vo.RobotLogDetailBean;

/**
 * 
 * @author Mr.li
 * 
 */
public class RobotLogDetailListAction extends Action {

    /**
     * Logger for this class.
     */
    private static final Logger logger = Logger
            .getLogger(RobotLogDetailListAction.class);

    private RobotLogService robotLogService;

    /**
     * @param mapping struts mapping
     * @param request request
     * @param form action form
     * @param response response
     * @return action forward
     * @throws Exception any exception
     */
    public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {

        String idRobotLog = request.getParameter("id");
        List<RobotLogDetailBean> logDetailList = robotLogService
                .getRobotLogDetailListByRobotLogId(Long.parseLong(idRobotLog));

        request.setAttribute("RA_PAGER_ITEMS", logDetailList);
        return mapping.findForward(GlobalConstant.FORWARD_SUCCESS);
    }

    /**
     * 
     * @param pRobotLogService
     */
    public void setRobotLogService(RobotLogService pRobotLogService) {
        robotLogService = pRobotLogService;
    }

}